package com.example.bigevent.mapper.system;

import com.example.bigevent.pojo.system.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface RoleMapper {

    /**
     * 根据角色名查询角色
     */
    @Select("select * from sys_role where role_name=#{roleName} and del_flag=0")
    @ResultMap("RoleResult")
    Role findByRoleName(String roleName);

    /**
     * 根据id查询角色
     */
    @Select("select * from sys_role where role_id=#{roleId} and del_flag=0")
    @ResultMap("RoleResult")
    Role findByRoleId(Integer roleId);
}
